package main

import (
	"bytes"
	"fmt"
	"github.com/PuerkitoBio/goquery"
	"log"
)

//var selector = "/html/body/div[3]/div/div[4]/div[2]"

func Parse() {
	path := "data/html/101000000308.html"
	data, _ := ReadFile(path)
	d := bytes.NewReader(data)
	dom, err := goquery.NewDocumentFromReader(d)
	if err != nil {
		log.Fatalln(err)
	}
	dom.Find(".table").Slice(1, 2).First().Find("td").Each(func(i int, s *goquery.Selection) {
		t := s.Last().Text()
		fmt.Println(t, i)
	})
	//dom.Find("#table-response").First().Text()
	//	Each(func(i int, s *goquery.Selection) {
	//	t :=  s.Find("td").Text()
	//	fmt.Println(i, t)
	//})
	//if e != nil {
	//	log.Fatalln(e)
	//}
}
